import { request, ResponsePageResult, type ResponseResult } from '@/service/base';
import {API_PREFIX} from "@/const/application.ts";

export async function addApiKey(params: {
  objectKey: string;
  objectName: string;
}): ResponseResult<boolean> {
  return request.post(API_PREFIX+`/apikey/add`, params);
}

export async function deleteApiKeyById(objectId: number): ResponseResult<boolean> {
  return request.delete(API_PREFIX+`/apikey/delete/${objectId}`);
}

export async function apikeyPage(params: { pageNum: number; pageSize: number;  }): ResponsePageResult {
  return request.post(API_PREFIX+'/apikey/page', params);
}
